<ion-view view-title="领单">
  <ion-content class="padding">

    <!--快递员扫码领取快件-->
    <div ng-if="(urole==1)">
      <div>
        <div class="item button-bar" >
          <a class="button button-royal" ng-click="barscanExpress1()">扫码派送快件</a>
        </div>
      </div>
      <div>
        <div class="item button-bar" >
          <input class="" type="tel" style="width: 75%;" ng-model="orderid1" placeholder="输入后6位连续快件单号">
          <a class="button button-positive" ng-click="getExpress1(orderid1)"><i class="icon ion-android-arrow-forward"></i></a>
        </div>
      </div>
    </div>
    <!--站长扫码领取快件-->
    <div ng-if="(urole==2)">
      <div>
        <div class="item button-bar" >
          <a class="button button-royal" ng-click="barscanExpress2()">扫码领取快件至站点</a>
        </div>
      </div>
      <div>
        <div class="item button-bar" >
          <input class="" type="tel" style="width: 75%;" ng-model="orderid2" placeholder="输入后6位连续快件单号">
          <a class="button button-positive" ng-click="getExpress2(orderid2)"><i class="icon ion-android-arrow-forward"></i></a>
        </div>
      </div>
    </div>

    <div>
      <div class="item button-bar" >
        <a class="button button-balanced" ng-click="getTransfer()">甩单列表</a>
      </div>
    </div>

    <div>
      <div class="item button-bar" >
        <a class="button button-assertive" ng-click="barscan()">扫码领单</a>
      </div>
    </div>
    <div>
      <div class="item button-bar" >
        <input class="" type="tel" style="width: 75%;" ng-model="orderid" placeholder="输入至少6位连续订单号">
        <a class="button button-positive" ng-click="getOrdersArray(orderid)"><i class="icon ion-ios-search-strong"></i></a>
      </div>
    </div>

    <div>
      <div class="item button-bar" >
        <a class="button button-calm" ng-click="barscanQuery()">扫码查单</a>
      </div>
    </div>

    <div class="list card" ng-repeat="order in ordersArray" href="#">
      <div class="item">
        <h2>{{order.areaName}}区-

          <span ng-if="(order.type != 9)" style="color: red;">{{order.type | orderTypeName}}</span>
          <span ng-if="(order.type == 9)">商家外卖</span>
            <span ng-bind-html="order.orderid | colorString">
            </span>
          <span ng-if="(order.expresstype == '定时送达')" style="color: red;">定时送达订单</span>
        </h2>
      </div>
      <div class="item item-body">
        <p>
          <i class="icon ion-ios-home" style="font-size: x-large;color: orange;"></i>
          {{order.toStreet}}
        </p>
        <p>
          <i class="icon ion-ios-people" style="font-size: x-large;color: orange;"></i>
          {{order.toName}}
          <a href="tel:{{order.toPhone}}">{{order.toPhone}}</a>
          <a href="tel:{{order.toPhone}}" class="icon ion-ios-telephone"></a>
        </p>
        <p >
          <i class="icon ion-arrow-graph-up-right" style="font-size: x-large;color: orange;"></i>
          {{order.status |  orderState }}
        </p>
      </div>
      <div class="row ">
        <div class="col">
          <button class="button button-assertive button-small button-block" ng-click="acceptOrder($index,'order')">
            <b>领取订单</b>
          </button>
        </div>
      </div>
    </div>
    <!--<div  class="list card" ng-repeat="order in ordersArray" href="#">-->
        <!--<div>-->
            <!--<span>{{order.orderid}}</span>-->
            <!--<span>待领单</span>-->
            <!--<span>{{order.area }}区</span>-->
            <!--<span ng-if="(order.type=== 9)">-->
                        <!--商家名称：{{order.sellerName}}&#45;&#45;{{order.get('storeName')}}-->
            <!--</span>-->
            <!--<span>{{order.toStreet}}</span>-->
            <!--<span>{{order.toName}}</span>-->
            <!--<span>{{order.remark}}</span>-->
            <!--<span><button class="button button-assertive " ng-click="acceptOrder($index)"> 领单</button></span>-->
        <!--</div>-->
    <!--</div>-->
    <div ng-if="(ordersArray.length === 0)" class="card">
      <div class="item item-text-wrap" style="color: red;">
        没有可领取的订单信息！！！(订单可能未打包完成或已派送完成或被撤销)，请勿领取
      </div>
    </div>
  </ion-content>
</ion-view>
